local kunjing = fk.CreateSkill {
  name = "kl__kunjing",
  tags = { Skill.Compulsory, Skill.AttachedKingdom },
  attached_kingdom = {"wei"},
}

Fk:loadTranslationTable{
  ["kl__kunjing"] = "困境",
  [":kl__kunjing"] = "魏势力技，锁定技，你的手牌数始终为4。",

  ["$kl__kunjing1"] = "哼！老将军，可知天水姜伯约？",
}

kunjing:addEffect(fk.AfterCardsMove, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(kunjing.name) and player:getHandcardNum() ~= 4
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    local num = 4 - player:getHandcardNum()
    if num > 0 then
      player:drawCards(num, kunjing.name)
    elseif num < 0 then
      room:askToDiscard(player, {
        min_num = -num,
        max_num = -num,
        include_equip = false,
        skill_name = kunjing.name,
        cancelable = false,
      })
    end
  end,
})


return kunjing
